import 'package:flutter/material.dart';

/// 自定义颜色
class EsColors {
  /// 主前景色  0xffea5504
  static const Color Primary = Color(0xffea5504);

  /// 主背景色 60%透明度
  static const Color BackGroundLevel1 = Color(0x991768E4);

  /// 二级背景色 9%透明度
  static const Color BackGroundLevel2 = Color(0x171768E4);

  /// 一级标题 黑 #222222
  static const Color Title = Color(0xff222222);

  /// 次级标题 黑 #333333
  static const Color TitleSecondary = Color(0xff333333);

  /// 内容 灰 #666666
  static const Color Content = Color(0xff666666);

  /// 次级内容 灰 #999999
  static const Color ContentSecondary = Color(0xff999999);

  /// 填充颜色 灰 #CCCCCC
  static const Color Fill = Color(0xffcccccc);

  /// line 灰 #efefef
  static const Color Line = Color(0xffefefef);

  /// 主要背景色 灰 #e4e4e4
  static const Color BackGround = Color(0xffe4e4e4);

  /// 次要背景色 灰 #f7f7f7
  static const Color BackGroundSecondary = Color(0xfff7f7f7);

  /// 主题白色
  static const Color White = Color(0xffffffff);

  ///  蓝色 #FC5517
  static const Color Blue = Color(0xff3a85ff);

  /// 科技色调 #020D2E
  static const Color Science = Color(0xff020d2e);

  /// 主粉红色 #e91e63
  static const Color Pink = Color(0xffe91e63);

  /// 钱 #c99f4f
  static const Color Money = Color(0xffc99f4f);
}

/// 字重
class EsFontWeights {
  static const FontWeight Light = FontWeight.w300;
  static const FontWeight Normal = FontWeight.normal;
  static const FontWeight Medium = FontWeight.w500;
  static const FontWeight Bold = FontWeight.bold;
  static const FontWeight SemiBold = FontWeight.w600;
}

/// 自定义尺寸
class EsSizes {
  /// 特殊大号 30
  static const double XXL = 30.0;

  /// 超大号 20
  static const double XL = 20.0;

  /// 大号 18
  static const double LG = 18.0;

  /// 一般 16
  static const double MD = 16.0;

  /// 小号 14
  static const double SM = 14.0;

  /// 极小号 12
  static const double XS = 12.0;

  /// 极极小号 10
  static const double XXS = 10.0;

  /// 极极极小号 10
  static const double XXXS = 8.0;
}

/// 渐变色
class EsColorLiner {
  /// 天蓝到深蓝
  static const SkyBlueToBlue = LinearGradient(colors: [
    EsColors.BackGroundLevel1,
    EsColors.Primary,
  ]);
  static const BlueToSkyBlue = LinearGradient(colors: [
    EsColors.Primary,
    EsColors.BackGroundLevel1,
  ]);

  ///#4CA5F1 #256CDE 纵向
  static const PortraitSkyBlueToBlue = LinearGradient(
      begin: Alignment.topCenter,
      end: Alignment.bottomCenter,
      colors: [
        EsColors.BackGroundLevel1,
        EsColors.Primary,
      ]);

  ///#FF9505 #FE5C02 纵向
  static const PortraitYellowToOrange = LinearGradient(
      begin: Alignment.topCenter,
      end: Alignment.bottomCenter,
      colors: [
        Color(0xffFF9505),
        Color(0xffFE5C02),
      ]);

  ///#FF8B42 #FF531F 横向
  static const PortraitOrangeToYellowHorizontal = LinearGradient(
      begin: Alignment.centerLeft,
      end: Alignment.centerRight,
      colors: [
        Color(0xFFFF8B42),
        Color(0xFFFF531F),
      ]);

  ///透明黑色蒙版
  static const PortraitTransMask = LinearGradient(
      begin: Alignment.topCenter,
      end: Alignment.bottomCenter,
      colors: [
        Color(0x00000000),
        Color(0x54000000),
        Color(0x8C000000),
      ]);

  ///透明黑色蒙版
  static const PortraitTransMaskReverse = LinearGradient(
      begin: Alignment.topCenter,
      end: Alignment.bottomCenter,
      colors: [
        Color(0x00000000),
        Color(0x34061231),
        Color(0xCC040613),
      ]);
}

/// 装饰
class EsDecoration {
  /// 卡片阴影 带圆角
  static const Decoration BoxShadowWithRadius = BoxDecoration(
      color: Colors.white,
      borderRadius: const BorderRadius.all(const Radius.circular(6.0)),
      boxShadow: [
        BoxShadow(
          color: Color(0x334758bf),
          blurRadius: 10.0,
          spreadRadius: 1.0,
        )
      ]);

  static const Decoration BoxShadowDefault = BoxDecoration(
      color: Colors.white,
      borderRadius: const BorderRadius.all(const Radius.circular(4.0)),
      boxShadow: [
        BoxShadow(
          color: Color.fromRGBO(71, 88, 191, 0.12),
          blurRadius: 8.0,
          spreadRadius: 1.0,
        )
      ]);

  static const Decoration BoxShadowRadius6 = BoxDecoration(
      color: Colors.white,
      borderRadius: const BorderRadius.all(const Radius.circular(6.0)),
      boxShadow: [
        BoxShadow(
          color: Color.fromRGBO(71, 88, 191, 0.12),
          blurRadius: 8.0,
          spreadRadius: 1.0,
        )
      ]);
  static const Decoration BoxShadowRadiusUp =
      BoxDecoration(color: Colors.white, boxShadow: [
    BoxShadow(
      color: Color.fromRGBO(71, 88, 191, 0.12),
      offset: Offset(0, -6),
      blurRadius: 8,
      spreadRadius: 0,
    )
  ]);

  static BoxDecoration boxShadowWithRadiusAndAsset(
      {double cornerRadius = 6.0, String backgroundAsset}) {
    return BoxDecoration(
        color: EsColors.White,
        borderRadius: BorderRadius.circular(cornerRadius),
        image: backgroundAsset != null
            ? DecorationImage(
                alignment: Alignment.topRight,
                image: AssetImage(backgroundAsset))
            : null,
        boxShadow: [
          BoxShadow(
            color: Color(0x334758BF),
            offset: Offset(0.0, 1.0),
            blurRadius: 8.0,
            spreadRadius: 0.0,
          )
        ]);
  }
}
